//***********************************************************************
//	File:		Moveable.h
//	Author:		Ryan Simmons
//	Course:		SGP 1405
//	Purpose:	Physics Simulation
//***********************************************************************
//***********************************************************************
//	Purposfully left blank for all comments regarding this file 
//	
//	
//	
//***********************************************************************


#pragma once
#include "Entity.h"

class Emitter; 

class Moveable :
	public Entity
{
public:
	//Trilogy
	Moveable() = default;
	virtual ~Moveable() = default;
	Moveable(const Moveable&) = default; 
	Moveable& operator =(const Moveable&) = default; 

	//Type
	virtual int GetType() const { return ENT_MOVEABLE; }

	//Interface
	void Update(float dt);
	void Render();
	void HandleCollision(const IEntity* pOther);
	void HandleEvent();
	SGD::Rectangle GetRect() const;
	void ModifyHealth(float hpAmount); 
	void ApplyFriction(float dt);

	//Accessors
	float			GetMass								(void)					{ return m_fMass; }
	float			GetDynamicFrictionCoefficient		(void)					{ return m_fDynamicFrictionCoefficient; }
	float			GetStaticFrictionCoefficient		(void)					{ return m_fStaticFrictionCoefficient; }
	float			GetHealth							(void)					{ return m_fHealth; }
	float			GetMaxHealth						(void)					{ return m_fMaxHealth; }
	float			GetSpeed							(void)					{ return m_fSpeed; }
	float			GetMaxSpeed							(void)					{ return m_fMaxSpeed; }
	bool			GetPassable							(void)					{ return m_bPassable; }
	Emitter*		GetTakeDamage						(void)					{ return m_peTakeDamage; }
	SGD::Vector		GetAcceleration						(void)					{ return m_vAcceleration; }
	SGD::Vector		GetForce							(void)					{ return m_vForce; }
	SGD::Vector		GetTotalForces						(void)					{ return m_vTotalForces; }
	SGD::Vector		GetFrictionForce					(void)					{ return m_vFrictionForce; }
	float			GetNormalForce						(void)					{ return m_fNormalForce; }
	float			Weight								(void)					{ return m_fWeight; }
	SGD::Vector		GetDragForce						(void)					{ return m_vDragForce; }
	float			GetDragForceCoefficient				(void)					{ return m_fDragCoefficient;}


	//Mutators

	void	SetMass								(float mass)			{ m_fMass = mass; }
	void	SetDynamicFrictionCoefficient		(float dfc)				{ m_fDynamicFrictionCoefficient = dfc; }
	void	SetStaticFrictionCoefficient		(float sfc)				{ m_fStaticFrictionCoefficient = sfc; }
	void	SetHealth							(float hp)				{ m_fHealth = hp; }
	void	SetMaxHealth						(float hpmax)			{ m_fMaxHealth = hpmax; }
	void	SetSpeed							(float speed)			{ m_fSpeed = speed; }
	void	SetMaxSpeed							(float speedmax)		{ m_fMaxSpeed = speedmax; }
	void	SetPassable							(bool pass)				{ m_bPassable = pass; }
	void	SetTakeDamage						(Emitter* pe)			{ m_peTakeDamage = pe; }
	void	SetAcceleration						(SGD::Vector accel)		{ m_vAcceleration = accel; }
	void	SetForce							(SGD::Vector force)		{ m_vForce = force; }
	void	SetTotalForces						(SGD::Vector force)		{ m_vTotalForces = force; }
	void	SetFrictionForce					(SGD::Vector force)		{ m_vFrictionForce = force; }
	void	SetDragForce						(SGD::Vector force)		{ m_vDragForce = force; }
	void	SetNormalForce						(float force)			{ m_fNormalForce = force; }
	void	SetWeight							(float weight)			{ m_fWeight = weight; }
	void	SetDragForceCoefficient				(float force)			{ m_fDragCoefficient = force; }

private:
	
	float			m_fHealth						= 0.0f; 
	float			m_fMaxHealth					= 0.0f;
	float			m_fMass							= 0.0f; 
	float			m_fDynamicFrictionCoefficient	= 0.0f; 
	float			m_fStaticFrictionCoefficient	= 0.0f;  
	SGD::Vector		m_vAcceleration					= SGD::Vector { 0 , 0 };
	SGD::Vector		m_vForce						= SGD::Vector { 0 , 0 };
	SGD::Vector		m_vTotalForces					= SGD::Vector { 0 , 0 };
	SGD::Vector		m_vFrictionForce				= SGD::Vector { 0 , 0 };
	SGD::Vector		m_vDragForce					= SGD::Vector { 0 , 0 };
	float			m_fWeight						= 0.0f;
	float			m_fNormalForce					= 0.0f;
	float			m_fSpeed						= 0.0f; 
	float			m_fRho							= 0.0f;
	float			m_fDragCoefficient				= 0.0f;
	float			m_fMaxSpeed						= 0.0f; 
	bool			m_bPassable						= true; 
	Emitter*		m_peTakeDamage; 


};

